package com.yixia.pea.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yixia.pea.domain.credit.PeaHzBase;
import com.yixia.pea.domain.credit.PeaScore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yixia.pea.domain.dto.PeaScoreDto;
import org.apache.ibatis.annotations.Param;

import java.util.Arrays;
import java.util.List;

/**
* @author 35038
* @description 针对表【pea_score】的数据库操作Mapper
* @createDate 2023-09-05 21:01:59
* @Entity com.yixia.pea.domain.credit.PeaScore
*/
public interface PeaScoreMapper extends BaseMapper<PeaScore> {

    // 分页查询
    List<PeaScoreDto> selectListPage( PeaHzBase hzBase);

    // 根据ID进行查询
    List<PeaScoreDto> selectScoreByHzId(@Param("hzId") Long hzId);


    // 根据户主ID进行删除
    default int deleteScoreByHzId(Long[] hzIds){
        List<Long> list = Arrays.asList(hzIds);
        LambdaQueryWrapper<PeaScore> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.in(PeaScore::getHzId, list);
        return this.delete(queryWrapper);
    }
}




